#include<stdio.h>

void Coprime(int m,int n)
{
	int a,b;
	a=m;
	b=n;
	while(m!=0&&n!=0)
	{
		if (m>n)
			m=m%n;
		else 
			n=n%m;
	}
	if (m==0)
		if (n==1)
			printf("%d\n",a*b);
		else 
			printf("%d\n%d\n",n,a*b/n);
	else
		if (m==1)
			printf("%d\n",a*b);
		else 
			printf("%d\n%d\n",m,a*b/m);
}

int main()
{
	int m,n;
	while(scanf("%d%d",&m,&n)==2)
		Coprime(m,n);
}
